<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden; /* 禁止滚动条 */
        }

        body {
            background-image: url('/public/static/images/bg2.png');
            background-size: cover; 
            background-position: center; 
            background-repeat: no-repeat; 
            display: flex;
            flex-direction: column;
        }

        .icon-bar {
            position: absolute;
            top: 30px;
            left: 30px;
        }

        .icon-bar button {
            background-color: #555;
            color: white;
            padding: 10px;
            border: none;
            cursor: pointer;
            float: right;
        }

        .icon-bar button:hover {
            background-color: #000;
        }

        .main {
            position: relative;
            width: 100%;
            height: auto;
            top: 200px;
        }

        .left {
            width: 35%;
            position: relative;
            float: left;
        }

        .left_1 {
            position: relative;
            margin-left: 100px;
        }

        .right {
            position: relative;
            width: 60%;
            float: left;
        }

        .right_2 {
            font-size: 30px;
            text-indent: 2em; 
        }

        .right_3 {
            position: relative;
            top: 40px;
        }

        .right_4 {
            position: relative;
            float: left;
            margin-right: 30px;
            text-align: center;
            margin: 0 35px; /* 添加左右间距 */
        }

        .right_4_1 {
            text-align: center;
            color: #D10506;
            font-size: 22px;
            font-weight: bold; 
        }

        .right_4 img {
            display: block;
            margin: 0 auto;
        }

        /* 让按钮位于图片中间下方 */
        .right_4_3 {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            bottom: -50px; /* 调整按钮到图片下方 */
            animation: shake 1.5s infinite ease-in-out;
        }
        .right_4 img {
            display: block;
            margin: 0 auto;
            border-radius: 10px;
            /* box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1); */
        }
        /* 摇晃动画 */
        @keyframes shake {
            0%, 100% { transform: translateX(-50%) translateY(0); }
            25% { transform: translateX(-50%) translateY(-5px) rotate(-2deg); }
            50% { transform: translateX(-50%) translateY(5px) rotate(2deg); }
            75% { transform: translateX(-50%) translateY(-3px) rotate(-1deg); }
        }

        .title{
            position: absolute;
            top: 30px;
            right: 50px;
        }
    </style>
</head>
<body>
    <div class="icon-bar">
        <button onclick="window.location.reload()"> <img src="/public/static/images/refresh.png" alt=""></button>
        <button onclick="window.location.href='home.html'"> <img src="/public/static/images/home.png" alt=""></button>
        <button onclick="window.history.forward()"> <img src="/public/static/images/forward.png" alt=""></button>
        <button onclick="window.history.back()"> <img src="/public/static/images/back.png" alt=""></button>
    </div>
    <div class="title">
        <!-- <div class="left_1"> -->
            <img src="/public/static/images/title2.png" alt="" width="600" height="200">
        <!-- </div> -->
    </div>
<div class="main">
    <div class="left">
        <div class="left_1">
            <img src="/public/{$record.img}" alt="" width="500" height="600">
        </div>
    </div>

    <div class="right">
        <div class="right_1">
            <div style="display: flex;align-items: center;">
                <img src="/public/static/images/dptitle.png" alt="" width="60" height="40">
            <h1>什么是毒品</h1>
            </div>
            
        </div>
        <div class="right_2">
            {$record.desc}
        </div>
        <div class="right_3">
            {foreach name="childRecord" item="v"}
                <div class="right_4">
                    <!-- 名称加粗 -->
                    <div class="right_4_1">
                        {$v.name}
                    </div>
                    <!-- 图片 -->
                    <div style="position: relative; display: inline-block;margin-top: 20px;border-radius: 15px;margin-left: 30px;">
                        <img src="/public/{$v.img}" alt="" width="400" height="300" >
                        <!-- 按钮固定在图片下方并晃动 -->
                        <div class="right_4_3">
                            <a href="{:url('index/index/clists',['id'=>$v['id']])}">
                                <img src="/public/static/images/djlj.png" alt="" width="150" height="100">
                            </a>
                        </div>
                    </div>
                </div>
            {/foreach}
        </div>
    </div>
</div>
</body>
</html>
